package br.com.condominio.model.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DB {

	private static final String DRIVER = "org.postgresql.Driver";
	private static final String SERVER = "localhost";
	private static final String DATABASE = "condominioDB";
	private static final String USER = "postgres";
	private static final String PASSWORD = "postgres";

	public Connection getConexao() throws ClassNotFoundException, SQLException {

		try {
			Class.forName(DRIVER);

			return DriverManager.getConnection("jdbc:postgresql://" + SERVER
					+ ":5432/" + DATABASE, USER, PASSWORD);

		} catch (ClassNotFoundException e) {
			throw new SQLException(e.getMessage());
		}
	}
}